package com.oms.system.service;

import com.oms.system.domain.OmsOrder;
import com.oms.system.domain.OmsOrderProduct;
import com.oms.system.domain.OrderGroup;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/***
 * 订单操作接口
 * @author  lucas
 */
public interface IOmsOrderService {
    /***
     * 根据搜索条件查询订单列表
     * @param order
     * @return
     */
    List<OmsOrder> getOrderList(OmsOrder order, List<Integer> ids, Boolean isAdmin);

    /***
     * 用户根据密码查询
     * @param uniCode
     * @return
     */
    OmsOrderProduct getOrderProductByUniCode(Long orderId, String uniCode, String userName);

    /***
     * 用户根据订单主键查询订单详细信息
     * @param id
     * @return
     */
    OrderGroup getOrderProductById(Long id);

    /***
     * 插入订单， 指定默认初始状态
     * @param omsOrder
     * @param omsOrderProduct
     */
    @Transactional(rollbackFor = Exception.class)
    void insertOrder(OmsOrder omsOrder, OmsOrderProduct omsOrderProduct);

    /***
     * 编辑订单， 状态不发生改变
     * @param omsOrder
     * @param omsOrderProduct
     */
    @Transactional(rollbackFor = Exception.class)
    void updateOrder(OmsOrder omsOrder, OmsOrderProduct omsOrderProduct);


    /***
     * 编辑状态
     * @param status
     * @param id
     */
    @Transactional(rollbackFor = Exception.class)
    void updateOrderStatus(Long id, Integer status);

    /***
     * 支持多选支持单选
     * @param ids
     */
    @Transactional(rollbackFor = Exception.class)
    void deleteOrder(List<Long> ids);
}
